﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
using JetLoginTool.Engine;
using System.Runtime.Remoting.Messaging;

namespace JetLoginTool
{
	public partial class frmNewVersion : Form
	{
		public frmNewVersion()
		{
			InitializeComponent();

			tabMain.TabPages.Remove(tbpDetails);
			Show();
		}
		public void NewVersionAvailable(string versionNumber)
		{
			Text = "New version of JetLoginTool";
			lblCurrent.Text = Application.ProductVersion;
			lblNew.Text = versionNumber;

			tabMain.TabPages.Add(tbpDetails);
			tabMain.TabPages.Remove(tbpChecking);
		}

		private void lblDownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Process.Start(lblDownload.Text);
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			DialogResult = System.Windows.Forms.DialogResult.OK;
			Close();
		}

		private void btnUpdateCancel_Click(object sender, EventArgs e)
		{
			DialogResult = System.Windows.Forms.DialogResult.Cancel;
			Close();
		}
	}
}
